/**********************************************************************
 * Project : WoWGuildRoster (http://www.codeplex.com/WowGuildRoster/)
 * Module  : DotNetWarcraft.WoWGuildRoster.Business.GuildError
 **********************************************************************
 * 
 * 
 * 
 **********************************************************************
 * License : All code is subject to licensing terms per the Microsoft
 *   Permissive License (Ms-PL) v1.1. For full license information,
 *   refer to the packaged license.txt file.
 **********************************************************************
 * Revision History:
 * -----------------
 * 2007-09-16 -- Cliff Simpkins: Initial Version
 **********************************************************************
 */
using System;
using System.Collections.Generic;
using System.Data;
using System.Text;

using DotNetWarcraft.Common;


namespace DotNetWarcraft.WoWGuildRoster.Business {
  /// <summary>
  /// Error entry about an error that was generated by the WoWGuildRoster application. The
  ///   error class is not intended to be interactive, but for retrieval from database and
  ///   then presented for user/admin purposes.
  /// </summary>
  public class GuildError {
    #region Protected Members
    protected int _error_id;
    protected int _load_id;
    protected int _roster_id;
    protected int _char_id;
    protected int _charstat_id;

    protected DateTime _error_datetime;
    protected String _error_type;
    protected String _error_wgr_info;
    protected String _error_message;
    #endregion
		#region Public Properties
    public int ErrorID {
      get	{ return _error_id; }
      set	{ _error_id = value; }
    }
		public int LoadID {
      get	{ return _load_id; }
      set	{ _load_id = value; }
    }
    public int RosterID {
      get	{ return _roster_id; }
      set	{ _roster_id = value; }
    }
    public int CharID {
      get	{ return _char_id; }
      set	{ _char_id = value; }
    }
    public int CharStat_ID {
      get	{ return _roster_id; }
      set	{ _roster_id = value; }
    }
    public int CharStatID {
      get {
        return _charstat_id;
      }
      set {
        _charstat_id = value;
      }
    }

    public DateTime Error_DateTime {
      get {
        return _error_datetime;
      }
      set {
        _error_datetime = value;
      }
    }
    public String Error_Type {
      get {
        return _error_type;
      }
      set {
        _error_type = value;
      }
    }
    public String Error_AppInfo {
      get {
        return _error_wgr_info;
      }
      set {
        _error_wgr_info = value;
      }
    }
    public String Error_Message {
      get {
        return _error_message;
      }
      set {
        _error_message = value;
      }
    }
    #endregion

		#region Constructors
		public GuildError() : base() {
      //Basic Variable Initialization
      this.ErrorID = -1;
      this.LoadID = -1;
      this.RosterID = -1;
      this.CharID = -1;
      this.CharStatID = -1;

      this.Error_DateTime = DateTime.MinValue;
      this.Error_Type = "";
      this.Error_AppInfo = "";
      this.Error_Message = "";
    }
    public GuildError(DataRow rosterSrc) : base() {
      this.ErrorID = SqlDataUtils.RetrieveDbInt(rosterSrc["error_id"]);
      this.LoadID = SqlDataUtils.RetrieveDbInt(rosterSrc["load_id"]);
      this.RosterID = SqlDataUtils.RetrieveDbInt(rosterSrc["roster_id"]);
      this.CharID = SqlDataUtils.RetrieveDbInt(rosterSrc["char_id"]);
      this.CharStatID = SqlDataUtils.RetrieveDbInt(rosterSrc["charstat_id"]);

      this.Error_DateTime = SqlDataUtils.RetrieveDbDate(rosterSrc["error_datetime"]);

      this.Error_Type = SqlDataUtils.RetrieveDbString(rosterSrc["error_type"]);
      this.Error_AppInfo = SqlDataUtils.RetrieveDbString(rosterSrc["error_wgr_info"]);
      this.Error_Message = SqlDataUtils.RetrieveDbString(rosterSrc["error_message"]);
    }
    #endregion

  }
}
